/*
 * @Author: CPS
 * @Date:   2020-08-20 10:16:40
 * @Last Modified by:   CPS
 * @Last Modified time: 2020-08-20 10:54:11
 */

const stylusSupremacy = require('stylus-supremacy'),
  defaultOptions = require('./defaultOptions.js'),
  fs = require('fs')

// console.dir(stylus)
const tar = fs.readFileSync('./test/test.stylus').toString()
const stylusContent = `
@import './ccvb.stylus'
$ccvbb = 'ccvbb'
// 组件容器 - 最外层
/{n}component
  display flex
  flex-grow 99
  flex-wrap nowrap
  min-height 200px
  max-height 450px
  justify-content space-between

  // 文件列表部分**********************************
  /{n}container
    $ccvbb = 'ccvbb'
    public()
    display flex
    flex-grow 1
    flex-direction column
    overflow hidden
    flex-wrap nowrap
    //{n}文件列表的文件夹名字
    /{n}title
      display flex
      line-height 25px
      width 100%
      height 25px

      svg
        margin-left 5px
        align-self center
        height 20px
        padding 2px
        flex-grow 0
        path
          fill #42b983
      span
        color #42b983
        align-self center
        flex-grow 99
        display inline-block
        margin-left -5px
        font-size 16px
        line-height 100%
        width -120px
        height 20px
        overflow-wrap break-word
`
// 导入配置
const formattingOptions = defaultOptions

const result = stylusSupremacy.format(
  tar, formattingOptions
)

console.log(result)